package com.thread1;

//自定义线程类


import java.util.stream.IntStream;

public class MyThread extends Thread{
    public MyThread(String name){
        super(name);
    }

    @Override
    public void run() {
        for (int i = 0; i < 3; i++) {
            System.out.println(getName()+"正在执行！"+i);
        }
        IntStream.range(0,3).forEach(i->
                System.out.println(getName()+"正在执行！"+i));
    }
}
